#include "MsgResentCond.h"
#include "../../utils/UnicodeStringComparer.h"

using namespace kc_sf;

// -------------------------------------------------------- //

MsgResentCond::MsgResentCond ( bool is_resent )
: c_resent( is_resent )
{
}

// -------------------------------------------------------- //

Logic::Symbol *MsgResentCond::clone() const
{
	return new MsgResentCond( *this );
}

// -------------------------------------------------------- //

bool MsgResentCond::eval( const Message &msg )
{
	bool is_resent = msg.isResent();
	if( !is_resent )
	{
		UnicodeStringComparer comparer( msg.mSubject );
		is_resent = comparer.contains( "fwd" ) || comparer.contains( "re" );
	}
	return is_resent;
}
